package com.larly.model.enums.user;

import lombok.Getter;


@Getter
public enum UserRoleEnum {

    ADMIN("admin", "管理员"),
    USER("user", "普通用户");

    private String key;
    private String value;

    UserRoleEnum(String key, String value) {
        this.key = key;
        this.value = value;

    }

    public static UserRoleEnum getByKey(String key) {
        for (UserRoleEnum value : UserRoleEnum.values()) {
            if (value.key.equals(key)) {
                return value;
            }
        }
        return null;
    }
}
